import random

# Get list of images in /images/randomheader/ folder
images =context.images.randomheader.getFolderContents({'portal_type':'Image'})

# Return a random choice of one of the images
bgimg_path = random.choice(images).getURL()

return bgimg_path